-
-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
All might legend/issue3333 #3410
Closed
AllMightLegend
wants to merge
11
commits into
matrix-org:main
from
AllMightLegend:AllMightLegend/issue3333
Closed
All might legend/issue3333 #3410
AllMightLegend
wants to merge
11
commits into
matrix-org:main
from
AllMightLegend:AllMightLegend/issue3333
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Key Features: Password Configuration: The PasswordConfig struct allows customization of the password validation requirements. This can be extended to include more complex policies as needed. YAML Configuration: The PasswordConfig struct could be loaded from a YAML file, enabling dynamic adjustment of the password requirements without code changes. Password Validation: The ValidatePassword function checks the length, presence of uppercase letters, lowercase letters, digits, and special characters based on the provided configuration. Sidecar Feature: A placeholder sidecarLogPasswordValidation function is included, where you could integrate with a logging service to track password validation attempts. Signed-off-by: AllMightLegend [email protected]
The issue involved ensuring that the ts parameter in Dendrite is correctly handled when the request is from an appservice, and that it is ignored or handled differently when not. The resolution was achieved through the following steps: Refactoring the Logic: The logic for processing the ts parameter was refactored into a separate function named HandleEventTimestamp. This function determines whether the request is from an appservice by calling isAppService(req). If it is, the function parses the ts parameter using httputil.ParseTSParam(req). If the request is not from an appservice, the function defaults to using the current time or another appropriate handling. Updating sendevent.go: The inline logic in sendevent.go that handled the ts parameter was replaced with a call to the new HandleEventTimestamp function. This ensures that the logic is centralized and can be easily tested and maintained. Creating Tests: A new test file, ts_param_test.go, was created in the testing directory. This file includes tests that cover various scenarios: When the ts parameter is valid and the request is from an appservice. When the ts parameter is invalid or missing. When the request is not from an appservice. Signed off by : `Srinjoy Sen Chowdhury [email protected]`
…tLegend/dendrite into AllMightLegend/issue3333
Sorry for closing this, feel free to join #dendrite-dev:matrix.org for further discussion. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request Checklist
Signed-off-by:
Srinjoy Sen Chowdhury [email protected]
The issue involved ensuring that the ts parameter in Dendrite is correctly handled when the request is from an appservice, and that it is ignored or handled differently when not. The resolution was achieved through the following steps:
Refactoring the Logic:
The logic for processing the ts parameter was refactored into a separate function named HandleEventTimestamp. This function determines whether the request is from an appservice by calling isAppService(req). If it is, the function parses the ts parameter using httputil.ParseTSParam(req). If the request is not from an appservice, the function defaults to using the current time or another appropriate handling.
Updating sendevent.go:
The inline logic in sendevent.go that handled the ts parameter was replaced with a call to the new HandleEventTimestamp function. This ensures that the logic is centralized and can be easily tested and maintained.
Creating Tests:
A new test file, ts_param_test.go, was created in the testing directory. This file includes tests that cover various scenarios:
When the ts parameter is valid and the request is from an appservice.
When the ts parameter is invalid or missing.
When the request is not from an appservice.